Segmented Control
Type
widget
Summary
A widget that shows a row of selectable horizontal segments.
A segmented control is a horizontal control that is made up of multiple segments, where each segment functions as a discrete button. Each segment can either show a label or an icon.
One or more of the segments can be highlighted by clicking on them. By default, only one segment at a time can be highlighted, but it is possible to allow multiple segments to be highlighted.
The segmented control is great for:
- displaying a set of different options in a settings window (for example, it is used to display text alignment in the LiveCode property inspector)
- switching between different cards in a stack
- displaying a set of toggleable settings
Description
A widget that shows a row of selectable horizontal segments.
A segmented control is a horizontal control that is made up of multiple segments, where each segment functions as a discrete button. Each segment can either show a label or an icon.
One or more of the segments can be highlighted by clicking on them. By default, only one segment at a time can be highlighted, but it is possible to allow multiple segments to be highlighted.
The segmented control is great for:
- displaying a set of different options in a settings window (for example, it is used to display text alignment in the LiveCode property inspector)
- switching between different cards in a stack
- displaying a set of toggleable settings
Related
property: itemLabels, itemIcons, hilitedItems, multipleHilites
Children Properties
Message
Name | Summary | Syntax |
---|---|---|
hiliteChanged | Sent when the hilite of the segmented control widget changes | hiliteChanged |
Property
Name | Summary | Syntax |
---|---|---|
foreColor | The default label or icon color | get the foreColor of <widget> set the foreColor of <widget> to <color> |
backColor | The default background color | get the backColor of <widget> set the backColor of <widget> to <color> |
hiliteColor | The background color of highlighted segments | get the hiliteColor of <widget> set the hiliteColor of <widget> to <color> |
borderColor | The border color | get the borderColor of <widget> set the borderColor of <widget> to <color> |
itemLabels | The labels displayed by each segment | get the itemLabels of <widget> set the itemLabels of <widget> to <labelList> |
hilitedItems | The currently highlighted segment indices | get the hilitedItems of <widget> set the hilitedItems of <widget> to <indexList> |
itemEnabled | Whether each segment is enabled or disabled. | get the itemEnabled of <widget> set the itemEnabled of <widget> to <booleanList> |
hilitedItemLabels | The currently highlighted segment labels | get the hilitedItemLabels of <widget> set the hilitedItemLabels of <widget> to <labelsList> |
multipleHilites | Whether multiple segments may be highlighted simultaneously | get the multipleHilites of <widget> set the multipleHilites of <widget> to { true | false } |
showBorder | Whether the widget has a border or not | get the showBorder of <widget> set the showBorder of <widget> to { true | false } |
itemMinExtents | The minimum width of each segment | get the itemMinExtents of <widget> set the itemMinExtents of <widget> to <numberList> |
itemIcons | The icons displayed by each segment | get the itemIcons of <widget> set the itemIcons of <widget> to <iconNames> |
hilitedItemIcons | The icons displayed by each segment when highlighted | get the hilitedItemIcons of <widget> set the hilitedItemIcons of <widget> to <iconNames> |
itemStyle | The segment display style | get the itemStyle of <widget> set the itemStyle of <widget> to <segmentStyle> |
itemNames | The names used to identify segments | get the itemNames of <widget> set the itemNames of <widget> to <nameList> |
toggleHilites | Whether a segment can be unhighlighted by clicking | get the toggleHilites of <widget> set the toggleHilites of <widget> to {true | false} |
hilitedItemNames | The currently highlighted segment names | get the hilitedItemNames of <widget> set the hilitedItemNames of <widget> to <nameList> |
rippleEffect | Whether to show a ripple effect on user interaction or not. | get the rippleEffect of <widget> set the rippleEffect of <widget> to <value> |
horizontal | Whether the segmented widget is horizontal or not | get the horizontal of <widget> set the horizontal of <widget> to {true | false} |
cornerRadius | The corner radius of the widget | get the cornerRadius of <widget> set the cornerRadius of <widget> to <value> |
itemCount | The number of segments shown | get the itemCount of <widget> set the itemCount of <widget> to <number> |
hilitedTextColor | The label or icon color for highlighted segments | get the hilitedTextColor of <widget> set the hilitedTextColor of <widget> to <pColor> |